Generally speaking, a prior-art nail gun is composed of a magazine and a nailing mechanism. The magazine accommodates nails and the nailing mechanism includes a trigger for the user to cock and shoot the nails. When there are nails loaded in a magazine of the nail gun, the nailing device typically shoots at least one nail every time the user cocks the trigger. However, when the magazine is empty, the user can still cock the trigger and the nailing device reacts to the user's cocking as usual but there is no nail to be shot. Moreover, the user may usually cock several more times to make sure that there is no nail in the magazine and such dry firing can substantially harm and even be self-destructive of the nailing device. Thusly, lives of the nail guns are shortened when such ineffective shooting occurs frequently.